add a message check service and refactor service code