Simplified some code.