refactor to use parseXxx instead of valueOf