refactor Parts::Part to encapsulate file detection logic