Cleaner JavaScript Dependency Injection Factory