refactor and documentation should be finished