Refactor ES and store the startup date in base