Ordering issues
Refactored to smaller IsValid method with data structure