refactor mvc