Simplified more of the code.