creating helper to reduce duplication