separated batterModel from view controller and enabled to update database