avoid code duplication