https://pragmaticbear.eu/class-factory/
Class Factory