Move callback mechanism to utilities.