Controller as class