Used upsert and changes rules to object literals