removed controller logic out of array for clarity