Change database factory implementation