two methods into one method