Added support for calling from code