Refactor home page code into haml