refactored for testing; now with proper controller declaration