move high level stuff to controller instread of in directive.