code styling improvements + javadocs