Moved migration logic to migration function, created timing logic in main metod