some ifs to switches