cleanup whc code
correct prototypes