remove traces and unused imports