Added skeleton of functions for directive and factory