Updated test cases also added helpers.
Minor refactoring and code cleaning.