Trimmed some redundant code.