Some structural changes.

Planning to re-write most stuffs.