why a new function instead of doing stuffs in the constructor?