Implemented JC-778
-refactor code according to recommendation