refactored delegate for clarity