extract method parseToken