slight optimization of general case