moved some commandwin functionality