Minor refactoring of examples