Mostly refactorings