refactoring define function list merge