where-clause instead of let
remove unused imports
move absPath to its own module

it didn't fit anywhere else.