refactoring messages and such - STILL WIP