Refactored and completed all files