update logic was moved to view