The newly extracted module here has significant changes to all the functions, but they achieve the same thing as before.