http://bin.cakephp.org/view/2133185130 how about sth like that, more DRY