refactor: cleanup integer conversion helper