#controller helper (with tests)