perhaps switch to using a `$foo = $selector? {` here,  I think it's easier on the eyes.