refactor some files