better switch statement