use val instead of def