Refactoring & documentation