Refactorings towards a potential compiler plugin.