refactor and kill dead code.
indentation normalization, copyright update.