Would be good to replace the hardcoded `100.` and `1000.` as well although I know this is legacy code and not yours.