[FIX] Orphan reservations are linked to prin avatar related to #1323
* refactoring
  + id -> uid, eid or pid according context
  + removed unused modules/exceptions and extra whitespace