Refactored to be more in line with ZF2 conventions.