Added minimal database cleaning