Removed some duplicate code.
Removed some duplicate code.


Former-commit-id: 03a2dfb506394e19d24c70371983bf32403ea5e0 [formerly 03a2dfb506394e19d24c70371983bf32403ea5e0 [formerly f6b5e15c1e55b1d8151783533bf94e4f64e24088]]
Former-commit-id: c6009c853c1c12794c8640070d11de0fac29b31e
Former-commit-id: 6c8fffe9635d85c7abae0603334b79594d79475e
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine