improve branch coverage unit tests