Cleaning up the code

Made several small changes to clean up the code. Used ruby idioms in some
places. Also, used a regex to better match signal data in case the message has
stuff like double blank spaces.