Refactor anonymous classes in ByteClass