A few little refactorings