Extended when-applied-to so that it can take multiple params