#JC-1869 Fixed messages and done some refactoring