Moved some functions.php stuff to their own class