Change using data from config class and change accessor from private to public
Add code example of conditional
Refactor code from nesting-if to easy understand