cleaned up controller classes by removing duplicate code