Reworked generator to accept both source and generation path