refactored bad template code in home.php