refactor configuration loader