Page loader refactor