better logging + cleanup