refactored test cases for controllers