refactor config loader, and new code for orders