Some refactoring.
Added the configuration class.