more work on decoupling the code