refactor and new documentation