refactoring on a page like suggested