Code style cleanup and documentation