Compact
Remove useless if
Change the name of some variables
Fixed style of function names
Removed any database interface in the controllers