Issue #2694357 by mbovan, Berdir, Denchev: Clean up entity type definitions, use more standard functionality