Edit vault and main form
refactoring factory for agent