A switch/case statement might be nicer here.