refactoring code that generates info files