Merge "Simplify synchronized code and add comments"