WIP remove left over copy-paste cruft
WIP add missing prototypes