Modularize code for injector spray test