Some code munging