Refactoring + comments in example