more refactoring merge fixes