I would change this to a case pattern match.