use winsave/restview to preserve additional view parameters
separate logic for different insertion strategies
remove whitespace