main: Simplify configuration loading using c++ capabilities

Change-Id: Ie5d99568abd1570d9f7c864af2d9ab86d40720c3