Why the init method is needed? Looks these codes can be put in the constructor.