refactor configuration and initialization logic into separate classes