refactored some files