cleanup of converter code, small changes to flash format