Use anonymous classes when possible