Refactored and intregrated.