cleanup some code that may be relevant to failing test
only get permanent repository when needed