move some controllers to directives