Encapsulate thorfile operations to reduce complexity