piggy: pulled out a bsic structure for code