Refactored namespace js