ported integration to kotlin