some cleanup, message size optimization