Refactoring in preparation for adding molecule tabs.