refactor classes and documentation