More code cleanup/optimization.