Cleaned up the old code