Refactor edit, delete and back url