refactor index & server