Refactor MessageProcessor implementation to use Task