Ruby - refactor to use config instance variable
C# - Refactor to not use exceptions as control flow