combine two methods into one