Some little refactorings