Refactor from old Tuples to new EntityApi