refactor, seperate Controller and View