Cleanup some logic in loadLUT()