condensing three ifs into one here

distinction between null&false doesn't really matter anyhow