* improve post and pre migration checks * prevent some more false positive * prevent another false positive * fix unused import * Apply suggestions from code review