separate generate_url() to utils module

Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>