refactor parseNumber