Refactored controller test