a little refactoring
a few style change
separate migrate scripts