refactoring prerequisite directives + set_header feature