refactored rank directives to use angular DI