refactor the source code for version control