- tried to remove malloc / free / strdup calls as these might not be available to embeded compiler