tiny cleanup. use pattern matching more cleverly