Close contextualviews when needed. Work in progress.