Medusa application patch structure

Set up of states and subpatches