merge nested ifs?