refactor the code
merge