Changed to a switch-method.