edited content, refactored, and added test cases for the controller class