apply 'Un-hardcode wobble reduction' PR by sprung (with some refactoring)