Large refactoring - change command resolution