More work moving functionality from controllers to directives