Added more unittest for the new functions added during refactoring