start of abstracting database layer