Redundant lines of code removed, password authentication added to controller.