implemented createUrl(type) as switch-case instead of if-cases