Add logging, cleanup