refactor: cleanup, rename trace functions & scopes