refactored so that ALL data goes into directive and not controller