Changing some methods visibilty and trying a little to be thread-safe