add branch unit test coverage & test missing branches