Code refactored. Finished.