Some minor optimsations