config + refactoring index to server