ks code cleaned