<apurva/priyanka> did some refactoring and removed some bugs