clean Database code