Define controller