praveen|refactoring and fixing tests