#JC-1184:
* Refactored code according to code review