moved relevant controllers inside directives