Cleanup replaceTokens