sets option variable for all entities and cleans code

Can you explain what and how is this working? And what's the purpose of '&' there?