Multiple smaller performance improvements