move private method into constructor