remove repetition in models and fix migration