Controller as function