and all this code will be simplified if efo is passed as a parameter.