revamped model with low level db connectivity