cleaning up message writer and tests