Structure fixes, modularise controllers and directives