adding page files and cleaning up code