cleanup and refactor to use multiple views