add support for defining methods and passin this as argument