Refactoring the Configuration class and minor code cleanups