Refactored code.
Clean up.