removing duplicate code in Withings konnector