put traces in if-statements for performance improvements