improve kcc infrastructure plus fix tests

@chathhorn please review