Move init code into object