Message fix and code refactor.