Updated TokenManager for readability and added comments.