Prevent deep class hierarchy for non-static inner classes