Code style improvements and documentation