split bussiness logic from view.