cleaned up with generic types and polymorphic deserealization