refactor + filepath listener