before removing the ifs, use switch