little refactoring and docblocks