Refactor configuration