replaced static paths with a more dynamic approach