JCR-2211 : Code re-factory