Moved functionality factories and directives