sets option variable for all entities and cleans code