Documentation + little refactoring