more advanced token generation