Cleaned up code before moving on to RDs.