Cleaned Up Controller Code