minor code structure change