examples refactored