reduced code duplication