remove switch statement in init