Simplified up some code.