R expression parsing moved out of generator functions to improve modularity and reusability
finished refactoring generator, module is now fully R independant