If you reorder this loop and pass in create_establishment({'occupants'=>$occupants}) you can avoid setting it directly down below.