refactored code to dynamically resolve file paths rather than rely on multiple constructor parameters