Simplified some extraneous code