Defining a filepath concept

remove some technical debt and add more robust tests on filename generation.