Applied Context Object pattern for refactoring. Added initial message format.