Refactor configuration management