refactored for testability. Teared apart the extraction of parameters from the message and performing the actual function.