use token function to avoid repetition