validation encapsulation