remove duplicated function create_window