Moved number conversion code to utils