Turn the id_to_token and token_to_id methods to helpers, so they can be
used all around the app