Separates database code into WCModel class