Make factory for security functions