KAS: refactored