Move db object initialization to models