Refactor create entity