refactor and more features
can specify a basedir for the renderer