refactoring the source code, remove the duplicated code