Log Shipping - refactorings for less I/O

* no writing to header after each commit
* some refactorings