Break down home_page method and add some tests