a little refactoring done