Moved tag analysis to the analyize_tag method.