Abstracted generating paths.
Reduced redundant code.