migrate to the new Entity pattern