optimized message handler
slight refactoring
removed hashing
removed whitespace and author