a little refacotring