Break main.php template into parts