What did the middle ages do in life for work?