Modularize attack code