refactored trace messaging