Add new replying rules and refactor.