Refactoring the Configuration class and minor code cleanups

Change-Id: I172f196a10d714dc3ebc3002e09633ccbc0fdbd9