Several refactorings