This would be better as a switch statement.