Controller factory