some more performance improvements with pair<>