remove redundant branch and improve branch coverage checks