Some refactoring related to whistle.