add code and tests for reusing instances