removed duplicate migrations and refactored code