Removing logic and placing it in a functions.php file