dep: refactored and documented