tweaking getToken() and parseToken()