Refactoring theme_entityinfo_tableschema to reduce complexity