migration fixes and cleaning