creating pattern as directive
converts controllers to directives
merge with master