[Refactoring] Speed up resolve command.