refactoring & documentation