declare directives script as a module and fix a bit code style.