switch config to js