MB: refactor angular directives