initial refactoring
flattened logic
introduce invalidExtension helper
refactoring logging
introduce getConfig helper
get rid of unnecessary syntax option