refactord add_token