move elasticsearch setup to a new file