Extracted some filename management functionality into a separate util class