Update documentation
Simplify code and minor changes