Added early DB code