Refactoring and example documentation