clean up ifs/switch