Rating trends and a small amount of code cleanup