EntityModel insert method changed and tests rewritten