wrap init code in a class method