SYL-59 CHANGED: cleaning up old functions
SYL-59 CHANGED: further refactoring on es and orm