Cleanup k item constructor

Clean up dead code introduced in test generation; remove performance bottleneck of the new rewrite algorithm.
Fair enough. It looks ok overall.