Move all class code to dynamic class creator