Extract condition validation into a method