updated kaapi
a bit of refactor