moved logic from view to classes