Performance optimization

todo