some changes to use mvc