Updated code for kis architecture