attempt to use cake pattern in controller. requires further investigation