updated UT added more use cases and code review changes