Completed first refactor of eldis scripts