finalized generic controller