Reduce duplicate code
Fixed tests, table is renamed during update process