Possible performance improvements, code cleanup, and more.