added data migration and logging functionality