Added table prefix support
added dbre modifications