example file sent to gist and factorization of code