refactor main file loop: remove code repositories from code context