refactored Config to be a bean