add setTable, setAttribute and minor clean ups