wip: Refactoring and Documentation