Refactor model.entity package to model