remove @todo after having written test
try dirname for getting part of url