moved initialization logic to the "init" method