Simplify database check script