Refactored database checker