refacterin js directroies