change to use reply method
refactor the codes, and abstract a message service