Reducing the complexity of the translateToken method.