Refactor signal and connection