Refactor elements and base page