Should pass IMParameters here (and everywhere) by const ref.