Fixing functionalities, refactoring, documentation update