General clean-up and build a structure