NAWQAAN-205

* Final commit on this, test have been added
* Also incorporated suggestions from code review