Refactor enums into classes