Move IsFree and GetPatternNumber in pattern_utils