refactored command compile process as GridCommandCompiler.