QED structure functions: a systematic approach