Refactor home page filtering in pages_controller

oops