Implemented db migration.
Refactored code(OOP).