little refactoring + java docs