Replace boilerplate code for finding Config directory

Use a method

Change-Id: Id73ab2f0fca2d3a5e0aa6a5ff99200a5eded7a10