alternative method for extension using a callback