Refactor code style in init method