refactor number parser