Made faster by removing excess database connections.