refactor utils, fix merge