code style fixes, semantics are preserved