Further attempts at performance improvements