Minor code refinements