refactor, added pathlib usage