move helper functions to functions.php