Cleand up the code for signal connecting