minor cleanup + more logging