Controller spec generator refactored