refactored testcases and controller