Improved test controller
Refactored some tests