Remove duplication with helper func.