finished encapsulating routing logic into controllers