Some refactoring and addtions.
Lots of refactorings to support new good stuffs...
This is working.