Improve code style and documentation