Refactored, inspired by "Single Compilation Unit pattern"