refactored  examples