Made isEqual also check database
Cleanup