refactor and create various directives and rename files