minor code optimization