migration and seed and optimizations