refactored project to comply to mvc pattern