minimize duplicate code