Moving things out of the monstrosity function, making things more logical.