Refacter

Refactor done.
Please merge.