grid controller refactored.