Refactored a bit.
Refactored a bit