Updating documentation + little refactoring