mostly range fixes and 1_000 format
rubocop rules, simplify code