coding style improvements + documentation