Removed excess and refactored.