OE-3584 - added logic to override ElementType inserts with custom required value, also cleaned the code a little