Consolidated some lines of code to take up less space.