after refactoring to a Model- MVC model