Refactoring + getting context/config properly sorted