use switch instead of massive if