minor code consolidation