Added namespace based on directories
Fixed location matching order