import cleanup (use same system (with hook) for st3 and st2, some minor refactorings