Refactor main page file into a variable