Refactored Directives and Controllers organised according to functionality