Refactoring for compability with Kohana 3.3.