It's probably fine to have it here. The dependency on root path and extension is rather ugly too.