A little refactoring