Adds token management code