Minor code restructuring.