to avoid code duplication