a little refactoring.