Some clean up and slight performance improvement.