refactor medusa configuration a bit