Refactoring + documentation update