separate view and logic