code style fixes, unused variables removed