refactor front pages controller