More cleanup, optimize controller