refactor code, user M-V structure