Refactored directives and services a lot