Refactored to add delegate methods.