Refactored blog.php method section