using better way to check for address type