refactor swConnection.