Added a template and proper URL handling