This ugly code is more robust in the face of multiple parameters