Refactored code
Refactored code


Former-commit-id: f74c1e6cf77920db39e27384666f414ab2630992 [formerly fdcae7956db36aa89a05180753bd6f4c0fa38e61]
Former-commit-id: 18b7ca6c8425ca4b09bd7649f4e486c7d2757624
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine