Use defer for mutex unlock and unconflate if else statements