Separate url handling helpers into module
Use helpers in test