Some basic performance improvements