updated templates and tests with refactored code on the home page