reverted bugfix changes but replaced nested function by direct call to increase compiler differences