Refactored base checking for code quality