Added template and ability to get local address