Added some example code for factor and using env variables