Did some cleanup and code style fixes