minor code optimizing