Improve code to avoid hardcoded paths