Added better type safety to address/socket