Added ability to use custom code for extensions