#276 avoid some repeated work