extract stuff into main view