fix access modifier, and use braces for single line loop