small optimisations from vtune profiling