Refactor flow tree construction and actually use display property.