Removed unused defined var and minor code style improvement.