a little refactor