merge and other refactorings