a little refactorign