restructuer code
can extract emails now