clean codes in controllers