Eliminate unnecessary file and refactor