Revert "Revert "final changes to close task #143""

This reverts commit d6bd2dd1ecb8e66b28e6d7cefabfbc68624f80d7.