Code refactor, more complete implementation of messages