Refactoring of connection file