Minor cleanup of some code