Add suppot for migrating logs from 2.0 to 2.1

- some code cleanup and refactors