pin optimization