enum serialization support, drop enum to int casts all over the codebase