* refactored to messages as tables
* added error return value
refactoring