avoided code duplication