There is a bug in Groovy that causes problems with closures and inner classes, so do not use inner classes for contexts.