just a  little refactoring