cleanup and inproved log output