separate controller and view scripts