Refactoring as its described in https://github.com/zendframework/zf2/pull/3530