Removing unused functions, updating docs, format code.