renaming and refactoring files, added some more code