trq-1886 Fixed this so that it will work if the  configuration parameter is set to true.
trq-1886 Did some refactoring.