refactor code: made some files