another little refactoring