Improved handling of factory instance