refactor: introduce small helper