refacor of models