further cleanup; additional messaging; better handling of pid files