got rid of global variables and unneeded files