Is there a reason not to simplify this to just `if (params.key)`? Same applies for similar checks below.