optimizing attachment selection