refactor parseToken