Created a utility class for closing common resources.