(#3062) - WIP - massive stupid refactoring to fix a one-liner bug