Added support for nested method definitions