Persists repository code_directory after defining it
Setting processing states
Refactored collect into a private method