deleted some files and refactored some code into smaller functions