Added support to work with classes using function call