refactor home page to use partials for if else statement