Get rid of global wariable. Added helper objects.