Refactor config. Add modular structuring

Refactor config. Add modular structuring