modularized the directive