View refactoring and more robust URL generation