Stylistic cleanup for kangjianbin's improvements

I haven't tested this fully myself, as I don't have a working ipop install, but the changes are pretty simple. I just modified some stuff to be more idiomatic and to match the surrounding code a bit better.