Predicate for array values template validation

Added predicate for checking that all values in array conform to specified requirements + refactoring