Refactored Config and added tests