Move open connections parser to separate function