cleanup and code style fixes