Refactoring magic armor generator