This can be better written as a case stmt.