Cleaned up old code. Refactored.