Clean database and unnecessary codes