move view closing code to view module