Refactor determining GHC version
Rearrange functions