cleanup and update xnlib