Some refactoring for ZF2