refactor type field in DB(from string to int)