Added migration batch, and refactored using findbugs.