first glance cleanup of directives.js