Some refactorings