Extract some code to directive and provider files
Lazy magic