Removed obsolete closures; removed global variables from controller declarations.