move function inside class, add default param