refactor create entity