split code into controllers and views