refactor files, basic page working