refactor pages and upload