Refactor to take advantage of Phalcon 2