Refactored more files