Refactoring to prepare the way for properly processing choose tags.