refactor entity type as enum, to be more readable.