#5 Uses of try with resource

# The resources are now using try with resources
# Refactoring to better legibility