Moved some functions to a function.php file