refactor configuration to a class