refactoring ot reduce cyclomatic complexity in _entityinfo_get_literal_type()