optimize controller