Injecting serviceLoader and calling "onlyOne" degrades performace. You are calling "onlyOne" everytime some screenshot is being taken and this is obviously not a good practice. Consider to move loading somewhere else (e.g. after listening to ScreenshooterExtensionConfigured) and produce FileNameBuilder there. In this class, just inject its instance.