refactored Controllers and a few other java classes