Added migrations and optimized process order