Some little refactoring