Convert anonymous inner classes to static inner classes