Refactoring in anticipation of adding molecule tab handling.