added directives, reference validation and more