splits condtional into separate ifs