refactor server_import and related files