refatoring urls and security