refactored entity factory, test harness
entity refactor