I doubt it. All this should probably be wrapped in a class and instantiated from the application. Which is annoying, because it makes it rather less elegant.