Record action in tables and remove uri commands
Refactor comment deletion code