New version with delegate instead of event listeners