a little refactoring;