Updated to use listeners