Fully finished. Need further refactory.

Fully finished. Need further refactory.