Moved debug output from factory class