The transition from independence to a relatively minor part of a larger union was not easily accepted. What was the purpose of the castle