moved stuff into factory instead of having globals
retreive data every second