Better settings management - also in JS