Avoid code duplication when building results table