Trim out unused code; reindent