kraken: refactoring