refactor implementaton of hook_ctools_plugin_directory by best practices