Minor code beautification and tweaks