Moves some logic around.  Maybe CLion issues.