refactor some result code