Log5 rewrite; with many changes