improving style and saving new records in db