refactored to have model and vc