Refactors Generator, extracts private methods for checking input args
and loading tex file.