merge refactor