Pass the repository file resource via instance attribute instead of a closure variable.