take unnecessary code out of Controller Action