minor code refinemen